package top.kaoshanji.p2ch06a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.IOException;

/**
 * 代码清单 p2ch06a-08：进程的输入和输出的继承式处理方式的示例
 * author kaoshanji
 * ^_^
 * create time 2025/1/17 18:25
 */
public class ProcessExample02 {

    private static final Logger logger = LogManager.getLogger(ProcessExample02.class);

    public static void main(String[] args) throws IOException {
        logger.info("...代码清单 p2ch06a-08：进程的输入和输出的继承式处理方式的示例...");

        ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/c", "dir");
        pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
        pb.start();

    }


}
